{__NOLAYOUT__}

<include file="Public/meta"/>
        
        

        <div class="container-fluid">
            <div class="row-fluid">
                    
<div class="btn-toolbar">
    <button class="btn btn-primary" id="submit"><i class="icon-save"></i> 提交</button>
    <!-- <a href="#myModal" data-toggle="modal" class="btn">删除</a> -->
  <div class="btn-group">
  </div>
</div>
<div class="well">
    
    <div id="myTabContent" class="tab-content">
      <div class="tab-pane active in" id="home">
    <form id="tab" method="post">
        <label>权限名称</label>
        <input type="text" value="" class="input-xlarge" id="auth_name" name='auth_name'>
        
        

          <label>父级权限</label>
          <select name="pid" id="pid" class="input-xlarge">
            <option value="0">==请选择==</option>
            <volist name="list" id="vo">
              <option value="{vo.auth_id}">{$vo.auth_name}</option>
              <volist name="vo['child']" id="vol">
                <option value="{$vol.auth_id}"> &nbsp; &nbsp;|`{$vol.auth_name}</option>
              </volist>
            </volist>
          </select>

        <label>模块名称</label>
        <input type="text" value="" class="input-xlarge" id="auth_module" name='auth_module'>
        <label>控制器名称</label>
        <input type="text" value="" class="input-xlarge" id="auth_controller" name='auth_controller'>
        <label>方法名称</label>
        <input type="text" value="" class="input-xlarge" id="auth_action" name='auth_action'>
         
          
        <label>是否显示</label>
        <select name='status' style="width:100px">
          <option value="0">隐藏</option>
          <option value="1">显示</option>
        </select>
        

       

    </form>
      </div>
      
  </div>

</div>


<!-- </div> -->


<script type="text/javascript">




  function auth_name_blur(){
      var auth_name = $('#auth_name').val();
      if(auth_name==''){
        layer.msg('权限名称必须！',{icon:2,time:1000});return false;
      }else{
        return true;
      }
  }


  $('#auth_name').blur(function(){
      auth_name_blur();
  })

 


  $("#submit").click(function(){
 

      //提交前确认信息无误
      if(auth_name_blur()){
        
          $.post("",$("#tab").serialize(),function(msg){
              if(msg.code=='1'){
                layer.msg(msg.info,{icon:1,time:1000},function(index){
                  window.parent.location.reload();
                });

              }else{
                layer.msg(msg.info,{icon:2,time:1000});
                return false;
              }
          })
        
      }
      


      
  })
  
</script>